package ATM.gui;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.Color;

public class Deposit extends JPanel {
	private JTextField textFieldDeposit;
	Screen screen;

	/**
	 * Create the panel.
	 * @param screen 
	 */
	public Deposit(Screen screen) {
		this.screen = screen;
		setLayout(null);
		
		JLabel lblNewLabel = new JLabel("Please enter the deposit amount :");
		lblNewLabel.setBounds(184, 64, 261, 14);
		add(lblNewLabel);
		
		JButton b1 = new JButton("1");
		b1.setBounds(184, 114, 69, 52);
		add(b1);
		
		JButton b2 = new JButton("2");
		b2.setBounds(263, 114, 69, 52);
		add(b2);
		
		JButton b3 = new JButton("3");
		b3.setBounds(342, 114, 69, 52);
		add(b3);
		
		JButton b4 = new JButton("4");
		b4.setBounds(184, 177, 69, 52);
		add(b4);
		
		JButton b5= new JButton("5");
		b5.setBounds(263, 177, 69, 52);
		add(b5);
		
		JButton b6= new JButton("6");
		b6.setBounds(342, 177, 69, 52);
		add(b6);
		
		JButton b7= new JButton("7");
		b7.setBounds(184, 240, 69, 52);
		add(b7);
		
		JButton b8= new JButton("8");
		b8.setBounds(263, 240, 69, 52);
		add(b8);
		
		JButton b9= new JButton("9");
		b9.setBounds(342, 240, 69, 52);
		add(b9);
		
		JButton b0 = new JButton("0");
		b0.setBounds(261, 303, 71, 52);
		add(b0);
		
		textFieldDeposit = new JTextField();
		textFieldDeposit.setBounds(184, 89, 227, 20);
		add(textFieldDeposit);
		textFieldDeposit.setColumns(10);
		
		JButton btnDeposit = new JButton("Deposit");
		btnDeposit.setForeground(new Color(60, 179, 113));
		btnDeposit.setActionCommand("DepositFunds");
		btnDeposit.addActionListener(screen.getaL());
		btnDeposit.setBounds(342, 303, 148, 52);
		add(btnDeposit);
		
		JButton btnExit = new JButton("Exit");
		btnExit.setActionCommand("Exit");
		btnExit.addActionListener(screen.getaL());
		btnExit.setBounds(421, 177, 69, 115);
		add(btnExit);
		
		b1.setActionCommand("d1");
		b1.addActionListener(screen.getaL());
		b2.setActionCommand("d2");
		b2.addActionListener(screen.getaL());
		b3.setActionCommand("d3");
		b3.addActionListener(screen.getaL());
		b4.setActionCommand("d4");
		b4.addActionListener(screen.getaL());
		b5.setActionCommand("d5");
		b5.addActionListener(screen.getaL());
		b6.setActionCommand("d6");
		b6.addActionListener(screen.getaL());
		b7.setActionCommand("d7");
		b7.addActionListener(screen.getaL());
		b8.setActionCommand("d8");
		b8.addActionListener(screen.getaL());
		b9.setActionCommand("d9");
		b9.addActionListener(screen.getaL());
		b0.setActionCommand("d0");
		b0.addActionListener(screen.getaL());

		JLabel image = (new JLabel(screen.getVariables().getImage1() ));
		image.setBounds(0, 0, 640, 480);
		add(image);
	}

	public JTextField getTextFieldDeposit() {
		return textFieldDeposit;
	}

	public void setTextFieldDeposit(JTextField textFieldDeposit) {
		this.textFieldDeposit = textFieldDeposit;
	}
}
